package com.kuang.design.structural.adapter.clazz;

import com.kuang.design.structural.adapter.EN_ZhTranslator;
import com.kuang.design.structural.adapter.Player;


/**
 * 通过继承的方式：类结构模型，适配器转化到了翻译器功能上
 */
public class ZhMoviePlayerAdapter extends EN_ZhTranslator implements Player {
    private Player target;//被适配对象

    public ZhMoviePlayerAdapter(Player target) {
        this.target = target;
    }

    @Override
    public String play() {
        String play = target.play();
        //转换字幕 方法一：类直接继承翻译器
        return play;
    }
}
